<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$websetup.webname}</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Css/index.css" />
<load href="__PUBLIC__/Js/jquery.js"/>
<load href="__PUBLIC__/Js/utils.js"/>
<script>
function switch_province(p_id){
	$.ajax({
		type:"GET",
		cache:false,
		async:false,
		dataTYpe:"json",
		data:"p_id="+p_id,
		url:"{:U('Order/get_city_list')}",
		success:function(city_list){
		  var city_list = eval(city_list);	
		  var option_html = "";
		  $.each(city_list,function(i,n){
			   option_html+="<option value='"+n.id+"'>"+n.region_name+"</option>";
		  });
		  $("#region_id").html(option_html);
		}
	});
}
Utils.isChinese=function(text){
	//中文
	var reg=/^[\u4e00-\u9fa5]{1,}$/;
	return reg.test(text);
}
function check_order_form(theform){
	var name=theform.name.value;//真实姓名
	var phone=theform.phone.value;//联系电话
	var email=theform.email.value;//email
	var address=theform.address.value;//真实地址
	
	if(!Utils.isChinese(name)){
	  alert('你输入的姓名格式有误');
	  theform.name.focus();
	  return false;	
	}
	if(!Utils.isTel(phone)){
	  alert('你输入的联系电话格式有误');
	  theform.phone.focus();
	  return false;	
	}
	if(!Utils.isEmail(email)){
	  alert('你输入的email格式有误');
	  theform.email.focus();
	  return false;	
	}
	if(address.length<=0){
	  alert('请输入你的真实地址');
	  theform.address.focus();
	  return false;
	}
	return true;
	theform.order_btn.disabled=true;
	
}
</script>
</head>
<body>
<!-- layout::Home:Public:top::0 -->
<div class="all_div mt8">
	<div>当前位置：<a href="__APP__">首页</a>&nbsp;&gt;&nbsp;<span id="site_tit">下订单</span></div>
	<div class="news_tit">用户订单</div>
	<div class="order_con">
		<form id="form_order" name="form_order" method="post" action="{:U('Order/insert_order')}">
			<div class="clearfix mb20">
				<div class="order_tit">真实姓名：</div>
				<div class="fl_l"><input type="text" name="name" id="name" class="order_text"></div>
				<div class="order_bxx">*</div>
			</div>
			<div class="clearfix mb20">
				<div class="order_tit">联系电话：</div>
				<div class="fl_l"><input type="text" name="phone" id="phone" class="order_text"></div>
				<div class="order_bxx">*</div>
			</div>
			<div class="clearfix mb20">
				<div class="order_tit">邮    箱：</div>
				<div class="fl_l"><input type="text" name="email" id="email" class="order_text"></div>
				<div class="order_bxx">*</div>
			</div>
			<div class="clearfix mb20">
				<div class="order_tit">真实地址：</div>
				<div class="fl_l"><input type="text" name="address" id="address" class="order_text2"></div>
				<div class="order_bxx">*</div>
			</div>
			<div class="clearfix mb20">
				<div class="order_tit">所在地域：</div>
				<div class="fl_l">
                <select id="province" name="province" onchange="switch_province(this.value);">
                  <volist name="province_list" id="vo">
                    <option value="{$vo.id}">{$vo.region_name}</option>
                  </volist>
                </select>
                <select id="region_id" name="region_id">
                   <volist name="first_city_list" id="vo">
                    <option value="{$vo.id}">{$vo.region_name}</option>
                  </volist>
                </select>
                </div>
				<div class="order_bxx">*</div>
			</div>
			<div class="mb20"><span style="font-size:14px;">其他相关信息：</span></div>
			<div class="mb20"><textarea name="content" id="content" rows="" cols="" class="order_area"></textarea></div>
            <input type="hidden" name="all_shop_price" id="all_shop_price" value="{$all_shop_price}"/>
			<div class="clearfix mb20">
				<div class="fl_l"><input type="Submit" id="order_btn" name="order_btn" value=""  class="order_btn1" onclick="return check_order_form(this.form);"></div>
				<div class="fl_l"><input type="reset" value="" onclick="" class="order_btn2"></div>
			</div>
		</form>
	</div>
</div>
<!-- layout::Home:Public:bottom::-1 -->
</body>
</html>